// 格式化时间
export function filterDate(date: string | number | Date) {
  const newDate = new Date(date);
  const yy =
    newDate.getFullYear() > 9
      ? newDate.getFullYear()
      : "0" + newDate.getFullYear();
  const mm =
    newDate.getMonth() + 1 > 9
      ? newDate.getMonth() + 1
      : "0" + (newDate.getMonth() + 1);
  const dd =
    newDate.getDate() > 9 ? newDate.getDate() : "0" + newDate.getDate();
  const HH =
    newDate.getHours() > 9 ? newDate.getHours() : "0" + newDate.getHours();
  const mn =
    newDate.getMinutes() > 9
      ? newDate.getMinutes()
      : "0" + newDate.getMinutes();
  const SS =
    newDate.getSeconds() > 9
      ? newDate.getSeconds()
      : "0" + newDate.getSeconds();
  return yy + "-" + mm + "-" + dd + "  " + HH + ":" + mn + ":" + SS;
}
